/*
 * Copyright 2012-2013 EZC Group S.A. RCS Luxembourg B140949
 * 
 * Licensed under the Apache License, Version 2.0 (the "License"); you may not
 * use this file except in compliance with the License. You may obtain a copy of
 * the License at
 * 
 * http://www.apache.org/licenses/LICENSE-2.0
 * 
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
 * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
 * License for the specific language governing permissions and limitations under
 * the License.
 */

package com.yobidrive.y3.exceptions;

/**
 * Defines all the possible error codes that could be sent by the server or client.
 * @author david
 *
 */
public class Y3ErrorCode {
	
	public static final int	ERRCODE_NOERROR						=    0 ; 
	
	public static final int	ERRCODE_BAD_DIGEST					= -400 ; //MD5Digest in query doesn't match MD5 computed server side 
	
	public static final int ERRCODE_AUTHFAILED 					= -501 ; //Authentication failed for another reason
	public static final int ERRCODE_AUTHFAILED_NO_TOKEN			= -502 ; //No token
	public static final int ERRCODE_AUTHFAILED_NO_USER			= -503 ; //No user in the Authorization header
	public static final int ERRCODE_AUTHFAILED_INVALID_TOKEN	= -504 ; //Invalid token (not existing or not valid anymore)
	public static final int ERRCODE_AUTHFAILED_USER_MISMATCH	= -505 ; //User in Authorization mismatch from user in token
	public static final int ERRCODE_AUTHFAILED_ACCOUNT_BLOCKED	= -506 ; //Account is blocked
	public static final int ERRCODE_SAFE_SECRET_MISSING 		= -520 ; //No available safe secret!
	public static final int ERRCODE_SAFE_SECRET_INVALID			= -521 ; //Safe secret is not valid
	public static final int ERRCODE_SAFE_SECRET_EXPIRED 		= -522 ; //Safe secret has timed-out
	public static final int ERRCODE_NO_KEYS_ATTACHED 			= -530 ; //No eKey attached to the user account
	public static final int ERRCODE_INSUFFICIENT_CREDITS		= -540 ; //Not enough credits to perform operation
	public static final int ERRCODE_DISALLOWED					= -542 ; //Forbidden due to drive or subscription configuration
	public static final int ERRCODE_STRONGAUTH_REQUIRED			= -543; 
	
	public static final int	ERRCODE_NOACCESS					= -600 ; //No access to the requested item
	public static final int	ERRCODE_BAD_APIKEY					= -610 ;
	public static final int	ERRCODE_BAD_APISIGN 				= -611 ; 

	public static final int	ERRCODE_ALREADY_EXISTS				= -650 ; //Resources creation failed because another one with the same name already exists	
	public static final int	ERRCODE_NOT_EMPTY					= -660 ; //
	
	public static final int	ERRCODE_INVALID_REQUEST				= -720 ; //Wrong resource, wrong method for resource, ...
	public static final int	ERRCODE_INVALID_URI					= -730 ; //Badly formatted path
	public static final int	ERRCODE_INVALID_PARAMETER			= -740 ; //Missing parameter or wrong type
	public static final int ERRCODE_INVALID_USERNAME			= -750 ; //Supplied username is invalid or blocked
	public static final int ERRCODE_DUPLICATE_USERNAME			= -751 ; //Supplied username is already registered (at creation time)
	public static final int ERRCODE_USERNAME_NOT_VALIDATED		= -752 ; //Supplied username is not activated
	public static final int ERRCODE_EXTERNAL_DOMAIN				= -753 ; //Supplied username belongs to an external domain
	public static final int	ERRCODE_INVALID_UID					= -760 ; //Supplied unique id was not found
	public static final int	ERRCODE_REMOTE_ABSENT				= -875 ; //Supplied unique id was not found
	
	public static final int ERRCODE_INTERNAL 					= -999 ;
	
	/*
	 * Below error codes are specific to the HTTP Client implementation
	 */
	public static final int	ERRCODE_HTTP						= -10000 ;
}
